﻿using Core.DataAccess.Model.Project.Entrepot;
using Core.Framework.Model.Common;
using System;
using System.Collections.Generic;
using System.Text;

namespace Core.IBusiness.IEntrepotModule
{
    /// <summary>
    /// 库存管理
    /// </summary>
    public interface IEntrepot
    {
        // 采购 退货 销售 损坏 产品模型  产品模型审核 产品属性操作 产品分类操作

        /**
         *  1. 产品分类
         *  2. 产品属性字典
         *  3. 产品模板                   - x
         *  4. 仓库产品                   - x
         *  5. 采购入库
         *  6. 销售出库
         *  7. 产品日志
         * */


        /// <summary>
        /// 获取分类
        /// </summary>
        /// <returns></returns>
        MethodResult<List<ProductType>> GetProductType(string project_token, Pagination pagination);

        /// <summary>
        /// 根据关键字查询分类包含子分类
        /// </summary>
        /// <param name="type_key"></param>
        /// <param name="project_token"></param>
        /// <returns></returns>
        MethodResult<ProductType> GetProductItemType(int type_key,string project_token);



        /// <summary>
        /// 分类相关操作
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sqlExecType"></param>
        /// <returns></returns>
        MethodResult<int> ProductTypeExec(ProductType model, SqlExecType sqlExecType);






        /// <summary>
        /// 字典TITLE相关操作
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sqlExecType"></param>
        /// <returns></returns>
        MethodResult<int> DicTitleExec(ProductParams model, SqlExecType sqlExecType);

        /// <summary>
        /// 字典内容操作
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sqlExecType"></param>
        /// <returns></returns>
        MethodResult<int> DicContentExec(ProductParamsDic model, SqlExecType sqlExecType);

        /// <summary>
        /// 获取字典title属性集合
        /// </summary>
        /// <param name="project_token"></param>
        /// <param name="pagination"></param>
        /// <returns></returns>
        MethodResult<List<ProductParams>> GerDicContent(string project_token, Pagination pagination);

        /// <summary>
        /// 获取指定字典内容
        /// </summary>
        /// <param name="param_key"></param>
        /// <param name="project_token"></param>
        /// <returns></returns>
        MethodResult<ProductParams> GerDicItemContent(int param_key, string project_token);



        /// <summary>
        /// 产品模板操作
        /// </summary>
        /// <param name="template">模板内容</param>
        /// <param name="sqlExecType">操作类型</param>
        /// <returns></returns>
        MethodResult<int> ProductTemplateExec(ProductTemplate template, SqlExecType sqlExecType);


        /// <summary>
        /// 确认产品模板
        /// </summary>
        /// <param name="temp_key"></param>
        /// <param name="project_token"></param>
        /// <returns></returns>
        MethodResult<int> ConfirmProductTemplate(int temp_key, string project_token);

        /// <summary>
        /// 获取指定分类产品模板
        /// </summary>
        /// <param name="type_key"></param>
        /// <param name="project_token"></param>
        /// <param name="pagination"></param>
        /// <returns></returns>
        MethodResult<List<ProductTemplate>> GetProductTemplate(int type_key, string project_token, Pagination pagination);

        /// <summary>
        /// 根据标题搜索产品模板
        /// </summary>
        /// <param name="title"></param>
        /// <param name="project_token"></param>
        /// <param name="pagination"></param>
        /// <returns></returns>
        MethodResult<List<ProductTemplate>> GetSeachProductTemplate(string title, string project_token, Pagination pagination);

        /// <summary>
        /// 获取指定产品模板
        /// </summary>
        /// <param name="temp_key"></param>
        /// <param name="project_token"></param>
        /// <returns></returns>
        MethodResult<ProductTemplate> GetItemProductTemplate(int temp_key, string project_token);


        /// <summary>
        /// 产品采购
        /// </summary>
        /// <param name="purchases"></param>
        /// <returns></returns>
        MethodResult<int> ProductPurchase(List<ProductPurchase> purchases);




        /// <summary>
        /// 产品销售
        /// </summary>
        /// <param name="sells"></param>
        /// <returns></returns>
        MethodResult<int> ProductSell(List<ProductSell> sells);

        /// <summary>
        /// 产品退货
        /// </summary>
        /// <param name="purchases"></param>
        /// <returns></returns>
        MethodResult<int> ProductReturnGoods(List<ProductPurchase> purchases);




        /// <summary>
        /// 注册产品库存
        /// </summary>
        /// <param name="skus"></param>
        /// <returns></returns>
        MethodResult<int> ProductSKU(List<ProductSku> skus);

        /// <summary>
        /// 修改库存
        /// </summary>
        /// <param name="sku_key"></param>
        /// <param name="count_stock"></param>
        /// <returns></returns>
        MethodResult<int> UpdateSKU(decimal sku_key, decimal count_stock);
    }
}
